package com.wrial.simple;
/*
 * @Author  Wrial
 * @Date Created in 13:17 2020/3/29
 * @Description 二叉树镜像
     4
   /   \
  2     7
 / \   / \
1   3 6   9
镜像输出：
     4
   /   \
  7     2
 / \   / \
9   6 3   1

 */

public class LeetCode_226_FaceTest27 {



    public TreeNode mirrorTree(TreeNode root) {
        if (root==null) return null;
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        mirrorTree(root.left);
        mirrorTree(root.right);
        return root;

    }
    public class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }

    }

}
